import { lazy } from "react";
// import { WapHomeO, DiamondO, OrdersO, VipCardO,UserO } from '@react-vant/icons';
export let mainRouter = [
    {
        path:"/index/home",
        element:lazy(()=>import("../page/index/Home")),
        icon:"WapHomeO",
        title:"首页"
    },
    {
        path:"/index/menulist",
        element:lazy(()=>import("../page/index/MenuList")),
        icon:"DiamondO",
        title:"菜单"
    },
    {
        path:"/index/order",
        element:lazy(()=>import("../page/index/Order")),
        icon:"OrdersO",
        title:"订单"
    },
    {
        path:"/index/shopcar",
        element:lazy(()=>import("../page/index/ShopCar")),
        icon:"VipCardO",
        title:"购物车"
    },
    {
        path:"/index/my",
        element:lazy(()=>import("../page/index/My")),
        icon:"UserO" ,
        title:"我的"
    }
]

const routes = [
    {
        from:"/",
        to:"/index/home"
    },
    {
        path:"/index",
        element:lazy(()=>import("../page/Index")),
        children:mainRouter
    },
    {
        path:"/detail/:id",
        element:lazy(()=>import("../page/Detail"))
    },
    {
        path:"/login",
        element:lazy(()=>import("../page/Login"))
    },
    {
        path:"*",
        element:lazy(()=>import("../page/Eorry404"))
    }
]

export default routes